﻿using Axiom.Hermetica.WPF.Models;
using Axiom.Hermetica.WPF.ViewModels;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Media.Imaging;
using System.Xml.Serialization;

namespace Axiom.Hermetica.WPF.SampleData
{
	public class SampleData : ViewModel
	{
		public SampleData()
		{
			BitmapImage bitmap = new BitmapImage();
			bitmap.BeginInit();
			bitmap.UriSource = new Uri("pack://application:,,,/Axiom.Hermetica.WPF;component/Assets/Images/Thumbnails/pdf-thumb.png");
			bitmap.EndInit();
			bitmap.Freeze();

			Items.Add(new Book()
			{
				Name = "Sample Book Data #1",
				Category = ".NET",
				Image = bitmap,
			});
			Items.Add(new Book()
			{
				Name = "Sample Book Data #2",
				Category = "Horror",
			});
			Items.Add(new Book()
			{
				Name = "Sample Book Data #3",
				Category = "Science Fiction",
			});
			Items.Add(new Book()
			{
				Name = "Sample Book Data #4",
				Category = ".NET",
			});

			SelectedItem = Items.First(a => a.Name == "Sample Book Data #1");
			SelectedItems.Add(Items.First(a => a.Name == "Sample Book Data #1"));
			SelectedItems.Add(Items.First(a => a.Name == "Sample Book Data #3"));
		}

		public override async void Load()
		{
			await Task.Run(() => { });
			return;
		}
	}
}
